home *** CD-ROM | disk | FTP | other *** search
- if(!com) var com={};
- if(!com.seostatus) com.seostatus={};
-
- com.seostatus.alexaRestrictions = function(){
- var pub = {};
- pub.pref = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
-
- pub.addPrivateSite = function()
- {
- var dlg = window.openDialog('chrome://seostatus/content/alexaRestrictedSites.xul', 'stb-addAlexaRestrictedSite-dialog', 'centerscreen,chrome,modal');
- }
-
- pub.deletePrivateSite = function()
- {
- var sitelist = document.getElementById( "stb-privatesitelist");
- var index = sitelist.selectedIndex;
- if( index > -1 )
- {
- sitelist.removeItemAt( index );
- }
- }
-
- pub.loadAllRestrictedSites = function(){
-
- var branch = pub.pref.getBranch("seostatus.");
- try
- {
- if(branch.prefHasUserValue("stb_alexa_restricted_total_num")){
- var numSites = branch.getIntPref("stb_alexa_restricted_total_num");
- //alert(numSites);
- for (var i=0; i < numSites; i++){
- var aSite = branch.getCharPref("stb_alexa_restricted_sites["+i+"]");
- document.getElementById( 'stb-privatesitelist' ).appendItem(aSite);
- }
- }
- }
- catch(e)
- {
- //alert("error: " + e);
- }
- }
-
- pub.setRestrictedSites = function(){
- var branch = pub.pref.getBranch("seostatus.");
-
- try{
- var theSites = document.getElementById("stb-privatesitelist");
- var numSites = theSites.getRowCount();
- //alert("numSites: " + numSites);
- branch.setIntPref("stb_alexa_restricted_total_num", numSites);
-
- for (var i=0; i < numSites; i++){
- branch.setCharPref("stb_alexa_restricted_sites["+i+"]", theSites.getItemAtIndex(i).label);
- // alert(theSites.getItemAtIndex(i).label);
- }
- }
- catch(e){
- //alert("error: " + e);
- }
-
- }
- return pub;
- }();
-